package com.yizn.learn.beautiful.service;

import com.yizn.learn.beautiful.config.APIException;
import com.yizn.learn.beautiful.config.AppCode;
import com.yizn.learn.beautiful.vo.ProductInfo;
import com.yizn.learn.beautiful.vo.ProductInfoQueryVo;
import org.springframework.stereotype.Service;

/**
 * project : my-learn
 * <p> service类 </p>
 *
 * @author yisl
 * @date 2023-01-13【星期五】
 **/
@Service
public class ProductInfoService {

    public ProductInfoQueryVo selectById(Integer id){
        ProductInfoQueryVo productInfoQueryVo = new ProductInfoQueryVo();
        productInfoQueryVo.setProductId(id);
        productInfoQueryVo.setProductName("泡脚");
        productInfoQueryVo.setProductPrice(0.01);
        productInfoQueryVo.setProductDescription("中药泡脚加按摩");
        productInfoQueryVo.setProductStatus(0);

        return productInfoQueryVo;
    }
    public ProductInfo selectInfo(ProductInfo productInfo){
        return productInfo;
    }

    public void selectError(){
        throw new APIException(AppCode.APP_ERROR, "订单号不存在：");
    }

}
